﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QtGui>
#include <QtCore>
#include <QComboBox>
#include <QSet>
#include <QWidget>
#include <QtWebKit>

class Presets;
class ConvertList;
class ConversionParameters;

namespace Ui {
class dealsofts;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT
    
public:
    explicit MainWindow(QTranslator&, QWidget *parent = 0);
    ~MainWindow();

protected:
    void paintEvent(QPaintEvent *);
    void mouseMoveEvent(QMouseEvent *);
    void mousePressEvent(QMouseEvent *);
    void changeEvent(QEvent *);
    
    void StartConversion(QString category);
private slots:
    void on_menuBtn_clicked();

    void on_pushButton_language_clicked();

    void on_pushButton_1_flv_clicked();

    void on_pushButton_2_android_clicked();

    void on_pushButton_3_apple_clicked();

    void on_pushButton_4_avi_clicked();

    void on_pushButton_5_wmv_clicked();

    void on_pushButton_6_mpeg_clicked();

    void on_pushButton_7_mkv_clicked();

    void on_pushButton_8_mp4_clicked();

    void on_pushButton_9_html5_clicked();

    void on_pushButton_10_ts_clicked();

    void on_pushButton_11_f4v_clicked();

    void on_pushButton_12_mov_clicked();

    void on_pushButton_13_3gp_clicked();

    void on_pushButton_14_asf_clicked();

    void on_pushButton_15_audio_clicked();

    void slotStartConversion();
    void refresh_action_states();
    void slotAddFilesToList();
    void slotHomeClicked();
    void slotLinkClicked(QUrl);
	void deleteList();

    void slotLeftClicked();
    void slotRightClicked();

	void colorSlot(QAction*);

    void updateSlot(void);
    void helpSlot(void);
private:
    bool check_execute_conditions();
    void add_files();
    bool load_presets();
    void translateUi();
private:
    Ui::dealsofts *ui;

    QTranslator& m_translator;

    QComboBox*  m_combobox;

    QPixmap m_pixmapBg;
    QAction *m_AactionAboutQt;
    QMenu *m_menu;

    QPoint m_pointStart;
    QPoint m_pointPress;

    QVector <QPushButton* > m_vecBtn;

    QString m_prev_path;

    QList<ConversionParameters> m_params;

    ///成员变量初始化;
    void initData();

    ///自定义窗口样式;
    void setNomalStyle();

    ///功能选择函数;
    void setCurrentWidget();

    Presets *m_presets;
    ConvertList *m_list;

    QWebView *m_view;
    QString m_homeURL;

	QString m_colorURL;
	QMap<QString,QString> m_colorMap;

    int m_selectLanaguageIndex;
};

#endif // MAINWINDOW_H
